
#include "netserver.h"

#include <stdlib.h>

//! [0]
NETServer::NETServer(QObject *parent)
    : QTcpServer(parent), m_deviceID(0)
{
}
//! [0]

//! [1]
void NETServer::incomingConnection(int socketDescriptor)
{
    thread = new NETThread(socketDescriptor, this);
    connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
    thread->setDeviceID(m_deviceID);
    thread->start();
}

void NETServer::setDeviceID(quint16 deviceID)
{
    m_deviceID = deviceID;
}
//! [1]
